<h1>Template Plugin</h1>

<p>The <em>template</em> plugin gives you access to template data and logic.</p>

<p>Not to be confused with the theme plugin, the template plugin has specific data passed to the page from PyroCMS' Template Library. This includes things like the body of the page and the title of the page.</p>

<p>The template plugin's slug is <strong>template</strong>, so it can be used like so:</p>

<pre class="tags">{pyro:template:<em>function</em>}</pre>

<h2>Functions</h2>

<h3>{pyro:template:title}</h3>

<p>Displays the title of the current page.</p>

<br />

<h3>{pyro:template:body}</h3>

<p>Displays the body of the current page.</p>

<br />

<h3>{pyro:template:metadata}</h3>

<p>Displays the metadata for the current page. This includes javascript, css, and metadata information for the head of the HTML document.</p>

<br />

<h3>{pyro:template:partial}</h3>

<p>Displays a template partial.</p>

<p><strong>Parameters</strong></p>

<table cellpadding="0" cellspacing="0">

	<tr>
		<th>Parameter</th>
		<th>Description</th>
	</tr>
	
	<tr>
		<td width="100">name</td>
		<td>Required. Name of the partial you want to display.</td>
	</tr>

</table>

<p><strong>Example:</strong></p>

<pre><code>{pyro:template:partial name="cool_partial"}</code></pre>

<pre><code>Check out this cool partial!</code></pre>

<br />

<h3>{pyro:template:has_partial}</h3>

<p>Displays content if a template partial exists.</p>

<p><strong>Parameters</strong></p>

<table cellpadding="0" cellspacing="0">

	<tr>
		<th>Parameter</th>
		<th>Description</th>
	</tr>
	
	<tr>
		<td width="100">name</td>
		<td>Required. Name of the partial you are checking for.</td>
	</tr>

</table>

<p><strong>Example:</strong></p>

<pre><code>{pyro:template:has_partial name="sidebar"}
	&lt;p&gt;Hello admin!&lt;/p&gt;
{/pyro:template:has_partial}
</code></pre>

<br />
